import React from 'react';
import Layout from '../../components/Layout';
import { RouteConfig } from './remaining';

// 懒加载BPM组件
const BPMModel = React.lazy(() => import('../../views/BPM/Model'));
const BPMTask = React.lazy(() => import('../../views/BPM/Task'));
const BPMProcessInstance = React.lazy(() => import('../../views/BPM/ProcessInstance'));

const bpmRoutes: RouteConfig[] = [
  {
    path: '/bpm',
    element: <Layout />,
    children: [
      {
        path: 'model',
        element: <BPMModel />,
        meta: {
          title: '流程模型',
          icon: 'model',
          noCache: false
        }
      },
      {
        path: 'task',
        element: <BPMTask />,
        meta: {
          title: '任务管理',
          icon: 'task',
          noCache: false
        }
      },
      {
        path: 'process-instance',
        element: <BPMProcessInstance />,
        meta: {
          title: '流程实例',
          icon: 'process',
          noCache: false
        }
      }
    ],
    meta: {
      title: 'BPM流程',
      icon: 'workflow',
      noCache: false
    }
  }
];

export default bpmRoutes;